#include <cstdio>

int q[ 1000 ], head, tail, n, m;
int li[ 100 ][ 100 ], c[ 100 ];

void init( )
{
    int i, t1, t2;
    for ( i = 0; i < n; i++ )
        c[ i ] = 0;
    while ( m-- )
    {
        scanf("%d%d", &t1, &t2);
        li[ t1 ][ c[ t1 ]++ ] = t2;
        li[ t2 ][ c[ t2 ]++ ] = t1;
    }
}

bool spfa( int p )
{
    int d[ 100 ], i, j, u;
    for ( i = 0; i < n; i++ )
        d[ i ] = 0xfffffff;
    d[ p ] = 0;
    head = tail = 0;
    q[ tail++ ] = p;
    while ( head < tail )
    {
        u = q[ head++ ];
        for ( i = 0; i < c[ u ]; i++ )
            if ( d[ u ] + 1 < d[ li[ u ][ i ] ] )
            {
                d[ li[ u ][ i ] ] = d[ u ] + 1;
                q[ tail++ ] = li[ u ][ i ];
            }
    }
    for ( i = 0; i < n; i++ )
        if ( d[ i ] > 7 )
            return true;
    return false;
}

int main( )
{
    int i;
    while ( scanf("%d%d", &n, &m) != EOF )
    {
        init( );
        for ( i = 0; i < n; i++ )
            if ( spfa( i ) )
                break;
        if ( i == n )
            puts("Yes");
        else
            puts("No");
    }
    return 0;
}
